<template>
	<el-tabs class="course_common_labels" v-model="courseType">
		<el-tab-pane label="全部" name="0"></el-tab-pane>
		<el-tab-pane v-for="(item, index) in courseLabel" :key="index" :label="item.name" :name="item.id"></el-tab-pane>
	</el-tabs>
</template>

<script>
import { mapGetters } from 'vuex';
export default {
	props: {
		value: { type: String, default: '0' }
	},
	data() {
		return {
			courseType: this.value
		};
	},
	computed: { ...mapGetters(['courseLabel']) },
	watch: {
		value(val) {
			this.courseType = val;
		},
		courseType(val) {
			this.$emit('input', val);
		}
	},
	mounted() {
		console.log(this);
	}
};
</script>

<style lang="scss" scoped>
.course_common_labels::v-deep {
	margin-top: 10px;
	.el-tabs__item {
		padding: 0 10px;
	}
}
</style>
